package dlg.code.builder2;

/**
 * 具体的建造者
 */
public class ConcreteBuilder extends AbstractBuilder {

    private Product product;

    public ConcreteBuilder() {
        product = new Product();
        // 设置默认值
        product.setName("RR");
    }

    @Override
    AbstractBuilder setName(String name) {
        product.setName(name);
        return this;
    }

    @Override
    AbstractBuilder setWidth(String width) {
        product.setWidth(width);
        return this;
    }

    @Override
    AbstractBuilder setHeight(String height) {
        product.setHeight(height);
        return this;
    }

    @Override
    Product getProduct() {
        return product;
    }
}
